package com.fastshopping.order.service.impl;

import com.fastshopping.order.dao.AccountMapper;
import com.fastshopping.order.pojo.Account;
import com.fastshopping.order.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public List<Account> findAll() {
        List<Account> list = accountMapper.selectAll();
        return list;
    }

    /*
     * @Author zhangdan
     * @Description //TODO 根据id查询账户信息
     * @Date 19:58 2020/6/4
     * @Param [id]
     * @return com.fastshopping.order.pojo.Account
     **/
    @Override
    public Account findById(int id) {
        Account account = accountMapper.selectByPrimaryKey(id);

        return account;
    }

    /*
     * @Author zhangdan
     * @Description //TODO 根据id查询账户明细
     * @Date 18:37 2020/6/5
     * @Param [id]
     * @return java.util.Map<java.lang.String,java.lang.Object>
     **/
    @Override
    public List<Map> findDetailById(int id) {
        return accountMapper.findDetailById(id);
    }
}
